<?php
include("backManager/User.php");
   if(isset($_GET["delId"])){//删除
       $delId=$_GET["delId"];
   	   $isSucc=User::delUserById($delId);
       if($isSucc){
       	  header("location:index.php?targetPhp=user/userList.php");
       }else{
       	   echo "alert('删除失败！')";
       }
   }

    $userList=User::getUserList();
?>
<div class="rightTop">
	<span>管理员列表</span>
</div>
<table class="bodyInside">
	<tr class="tableTitle">
	    <th>id</th>
		<th>用户名</th>
		<th>密码</th>
		<th>操作</th>
	</tr>
    <?php
      	foreach($userList as $keys=>$user){ 
		     echo "<tr align='center'>";
		     echo "<td>".$user->getId()."</td>";
	         echo "<td>".$user->getName()."</td>";
			 echo "<td>".$user->getPwd()."</td>";
			 echo "<td><a href='?targetPhp=user/updateUser.php&upId=".$user->getId()."'>修改</a>&nbsp;&nbsp;<a href='?targetPhp=user/userList.php&delId=".$user->getId()."'>删除</a></td>";		
			 echo "</tr>";
	    }
    ?>
</table>

